import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class set {

    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("abc");
        set.add("hello");
        set.add("abc");

        Iterator<String> it =  set.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

        //System.out.println(set);
    }
}
